package com.want.method;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.http.HttpMethod;

import java.lang.reflect.Type;
import java.util.List;

/**
 * 方法的信息
 *
 * @author WangZhiJian
 * @since 2021/12/4 0004
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class MethodInfo<T,V> {
    /**请求url*/
    private String url;
    /**请求方法*/
    private HttpMethod method;
    /**参数列表的信息*/
    private List<ParamInfo> paramTypeEnum;
    /**返回是flux还是mono*/
    private boolean returnFlux;
    /**返回对象的类型*/
    private Type returnElementType;
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ParamInfo {
        /**参数的类型枚举*/
        private ParamTypeEnum paramTypeEnum;
        /**参数的key*/
        private String key;
    }
    /**参数的类型枚举*/
    public static enum ParamTypeEnum{
        /**路径上的参数*/
        PARAM,
        /**路径后携带的参数*/
        ATTRIBUTES,
        /**请求体类型*/
        BODY;
    }
}
